;
layui.define(["table", "form"], function (exports) {
    tab = layui.table, tab.render({
        elem: "#LAY-web-list",
        url: layui.setter.base + "admin/help/listJson",
        cols: [[
            {
                field: "type",
                width: 100,
                title: "分类",
                sort: !0
            }, {
                field: "title",
                title: "标题",
                minWidth: 160
            }, {
                field: "content",
                title: "内容",
                minWidth: 200
            }, {
                field: "createtime",
                title: "创建时间",
                minWidth: 120
            }, {
                field: "updatetime",
                title: "更新时间",
                minWidth: 120
            }, {
                field: "editor",
                title: "编辑人",
                minWidth: 120
            }, {
                title: "操作",
                minWidth: 150,
                align: "center",
                fixed: "right",
                toolbar: "#table-content-list"
            }]],
        page: !0,
        limit: 10,
        limits: [10, 15, 20, 25, 30],
        text: {none: '暂无相关数据'}
    }), tab.on("tool(LAY-web-list)", function (row) {
        if ("update" === row.event) {
        	parent.layer.open({
                type: 2,
                title: "更新",
                content: layui.setter.base + "admin/help/updatePage?id="
                    + row.data.id,
                maxmin: !0,
                area: ["80%", "90%"],
                btn : [ "确定", "取消" ],
                yes : function(index, layero) {
                    // 点击确认触发 iframe 内容中的按钮提交
                    layero.find('iframe').contents().find(
                        "#layuiadmin-app-form-edit").click();
                }
            });
            return;
        }

        if ("delete" === row.event) {
            layer.confirm("确定删除本条记录？", function (e) {
                // 请求查询接口
                layui.admin.req({
                    url: layui.setter.base
                        + "admin/help/delete?id=" + row.data.id
                        + "&r=" + Math.random(),
                    data: null,
                    done: function (res) {
                        layer.msg(res.msg, {
                            offset: '15px',
                            icon: 1,
                            time: 1000
                        }, function () {
                            console.log("重新加载执行了")
                            layui.table.reload('LAY-web-list'); //重载表格
                        });
                    }
                });
                // 关闭
                layer.close(e);
            });
            return;
        }
    }), exports("help", {})
});
